Skip to main content

colors

Type

property

Summary

Specifies all the colors of an object, in shorthand form.

Syntax

set the colors of <object> to <colorsList>

Description

Use the colors property to get all eight basic color properties at once, or to set the colors of one object to be the same as the colors of another object.

For objects other than images, you can set all these colors individually; the colors property simply provides a shorter method of dealing with all of them at once. Each line of the colors corresponds to one of the following color properties :

  • Line 1: the < foregroundColor:::note[ Line 2: the backgroundColor ]

Line 3: the hiliteColor

  • Line 4: the borderColor
  • Line 5: the topColor
  • Line 6: the bottomColor
  • Line 7: the shadowColor
  • Line 8: the focusColor

:::

If you leave a line blank when setting the colors, the color property corresponding to that line is left unchanged.

If the colors property of an object reports a blank line, that color is not set for the individual object, but is inherited from the object's owner. Use the form the effective colors of object to obtain the colors used for the object, whether set for the object or inherited.

If a pattern is set for an object, that pattern is used instead of the corresponding color for that object.

Examples

put the colors of this stack into field "Colors"
put "blue" & return & \
"#EE98AA" & return & \
line 5 of the colorNames & return & \
220,180,200 & return & \
"yellow" & return & \
200,200,60 & return & \
"#334433" & return & \
"pink" into field "colors"
set the colors of button "mybtn" to field "colors"
set the colors of this stack to the colors of stack "Home"

function: mouseColor

glossary: color reference, image, inheritance, object, property

keyword: line

property: foregroundColor, backgroundColor, hiliteColor, borderColor, topColor, bottomColor, shadowColor, focusColor, linkColor, linkHiliteColor, owner, patterns, properties

command: answer color

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?